package com.xiaoshuidi.cloud.module.finance.dal.dataobject.finance;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xiaoshuidi.cloud.framework.tenant.core.db.TenantBaseDO;
import lombok.*;

import java.math.BigDecimal;

@TableName(value = "finance_account_balance_warning", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FinanceAccountBalanceWarningDO extends TenantBaseDO {
    @TableId
    private Integer id;
    private BigDecimal warningValue;
    private String remark;
    private String custType;
    private Integer notificationInterval;

    public Integer getNotificationInterval() {
        return notificationInterval == null ? 1 : Math.max(1, notificationInterval);
    }
}
